package day14.homework02.test04;

import java.util.concurrent.ArrayBlockingQueue;

/**
 * @author Xiao
 * @date 2021/8/7
 */
public class Test04 {
    /**
     * 4. 使用阻塞队列改进吃汉堡的案例
     */
    public static void main(String[] args) {
        ArrayBlockingQueue<String> abq = new ArrayBlockingQueue<>(1);
        Foodie f = new Foodie(abq);
        Cooker c = new Cooker(abq);
        Thread t1 = new Thread(f);
        Thread t2 = new Thread(c);
        t1.start();
        t2.start();
    }
}
